import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/mymsg", //我的个人页面
    name: "Mymsg",
    component: () => import("../views/Mymsg.vue"),
    meta: {
      hideHeader: true,
    },
  },
  {
    path: "/my", //我的主页
    name: "My",
    component: () => import("../views/My.vue"),
  },
  {
    path: "/test",
    name: "Test",
    component: () => import("../views/Test.vue"),
  },
  {
    path: "/forget", //忘记密码
    name: "Forget",
    component: () => import("../views/Forget.vue"),
  },
  {
    path: "/", //首页路由
    name: "Index",
    component: () => import("../views/Index.vue"),
  },
  {
    path: "/reg", //注册路由
    name: "Reg",
    component: () => import("../views/Reg.vue"),
  },

  {
    path: "/login", //登录路由
    name: "Login",
    component: () => import("../views/Login.vue"),
  },

  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/about",
    name: "About",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/About.vue"),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
